package com.zl.learning.json.gson;

import com.google.gson.*;

import java.lang.reflect.Type;

public class ClassRoomParser implements JsonDeserializer<ClassRoom> {
    private Gson gson = new Gson();

    @Override
    public ClassRoom deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        ClassRoom classRoom = gson.fromJson(json, ClassRoom.class);
        return classRoom;
    }
}
